Register allocation is the process of assigning hardware registers to variables and spilling those variables that can not be assigned a register. Innovation in computer architecture domain has resulted in challenges for register allocation. For example, applications from embedded architecture domain (network, multimedia and speech processing) extensively use narrow width data via packing and unpacking. A typical embedded application program may include unpacking packed input data items for further processing and accumulating temporary results in packed form for output processing.
Bitwidth-aware register allocation includes computing bitwidth information for variables at various program points using bit-section analysis and then pack narrow width variables before invoking a traditional register allocation algorithm. Bitwidth aware register allocation includes a variable packing algorithm, which packs multiple small sized variables into one single variable. Existing approaches to bin-packing problems, however, are slow and imprecise.